{-
 This file is part of the Clafer to Alloy Translator (clafer2alloy).

 Copyright (C) 2010 Kacper Bak <http://gsd.uwaterloo.ca/kbak>

 clafer2alloy is free software: you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 clafer2alloy is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public License
 along with clafer2alloy. (See files COPYING and COPYING.LESSER.)  If not,
 see <http://www.gnu.org/licenses/>.
-}
module Absclafer2alloy where

-- Haskell module generated by the BNF converter

newtype Ident = Ident String deriving (Eq,Ord,Show,Read)
data Module =
   Module [Declaration]
  deriving (Eq,Ord,Show,Read)

data Declaration =
   EnumDecl Ident [EnumId]
 | AbsClaferDecl GCard Ident Super Attr Elements
 | ClaferDecl Clafer
 | ConstDecl Constraint
  deriving (Eq,Ord,Show,Read)

data Clafer =
   Clafer GCard Ident Super Attr Essential Card Elements
  deriving (Eq,Ord,Show,Read)

data Constraint =
   Constraint Essential [LExp]
  deriving (Eq,Ord,Show,Read)

data Elements =
   ElementsEmpty
 | Elements [Element]
  deriving (Eq,Ord,Show,Read)

data Element =
   Subclafer Clafer
 | ClaferUse Name Essential Card Elements
 | Subconstraint Constraint
  deriving (Eq,Ord,Show,Read)

data Essential =
   EssentialEmpty
 | Essential
  deriving (Eq,Ord,Show,Read)

data Super =
   SuperEmpty
 | SuperColon Name
 | Super Name
  deriving (Eq,Ord,Show,Read)

data Attr =
   AttrEmpty
 | AttrSExp [ModId] SExp
 | AttrSuper [ModId] SExp
 | Attr [ModId] Nav
  deriving (Eq,Ord,Show,Read)

data GCard =
   GCardEmpty
 | GCardXor
 | GCardOr
 | GCardMux
 | GCardOpt
 | GCardInterval GNCard
  deriving (Eq,Ord,Show,Read)

data Card =
   CardEmpty
 | CardLone
 | CardSome
 | CardAny
 | CardInterval NCard
  deriving (Eq,Ord,Show,Read)

data GNCard =
   GNCard Integer ExInteger
  deriving (Eq,Ord,Show,Read)

data NCard =
   NCard Integer ExInteger
  deriving (Eq,Ord,Show,Read)

data ExInteger =
   ExIntegerAst
 | ExIntegerNum Integer
  deriving (Eq,Ord,Show,Read)

data Nav =
   NavJoin Nav Nav
 | NavArrow Nav Nav
 | NavIdent Ident
  deriving (Eq,Ord,Show,Read)

data Name =
   Name [ModId] Ident
  deriving (Eq,Ord,Show,Read)

data LExp =
   EIff LExp Iff LExp
 | EImplies LExp Implies LExp
 | EImpliesElse LExp Implies LExp LExp
 | EOr LExp Or LExp
 | EXor LExp Xor LExp
 | EAnd LExp And LExp
 | ENeg Neg LExp
 | ETerm Term
  deriving (Eq,Ord,Show,Read)

data Term =
   TermCmpExp CmpExp
 | TermSet SExp
 | TermQuantSet Quant SExp
 | TermQuantDeclExp [Decl] LExp
  deriving (Eq,Ord,Show,Read)

data Iff =
   Iff
  deriving (Eq,Ord,Show,Read)

data Implies =
   Implies
  deriving (Eq,Ord,Show,Read)

data And =
   And
  deriving (Eq,Ord,Show,Read)

data Xor =
   Xor
  deriving (Eq,Ord,Show,Read)

data Or =
   Or
  deriving (Eq,Ord,Show,Read)

data Neg =
   Neg
  deriving (Eq,Ord,Show,Read)

data CmpExp =
   ELt Exp Exp
 | EGt Exp Exp
 | EREq Exp Exp
 | EEq Exp Exp
 | ELte Exp Exp
 | EGte Exp Exp
 | ENeq Exp Exp
 | ERNeq Exp Exp
 | EIn Exp Exp
 | ENin Exp Exp
  deriving (Eq,Ord,Show,Read)

data Exp =
   ESetExp SExp
 | ENumExp AExp
 | EStrExp StrExp
  deriving (Eq,Ord,Show,Read)

data Quant =
   QuantNo
 | QuantLone
 | QuantOne
 | QuantSome
  deriving (Eq,Ord,Show,Read)

data ExQuant =
   ExQuantAll
 | ExQuant Quant
  deriving (Eq,Ord,Show,Read)

data SExp =
   SExpUnion SExp SExp
 | SExpIntersection SExp SExp
 | SExpDomain SExp SExp
 | SExpRange SExp SExp
 | SExpJoin SExp SExp
 | SExpArrow SExp SExp
 | SExpIdent Ident
 | SExpRIdent Ident Bool
  deriving (Eq,Ord,Show,Read)

data Decl =
   Decl ExQuant Disj [LocId] SExp
  deriving (Eq,Ord,Show,Read)

data Disj =
   DisjEmpty
 | Disj
  deriving (Eq,Ord,Show,Read)

data AExp =
   EAdd AExp AExp
 | ESub AExp AExp
 | EMul AExp AExp
 | EUmn AExp
 | ECSetExp SExp
 | EInt Integer
  deriving (Eq,Ord,Show,Read)

data StrExp =
   EConc StrExp StrExp
 | EStr String
  deriving (Eq,Ord,Show,Read)

data EnumId =
   EnumIdIdent Ident
  deriving (Eq,Ord,Show,Read)

data ModId =
   ModIdIdent Ident
  deriving (Eq,Ord,Show,Read)

data LocId =
   LocIdIdent Ident
  deriving (Eq,Ord,Show,Read)

